<template>
  <div class="follow">
    <img
      v-if="follow.head_img"
      :src="$axios.defaults.baseURL + follow.head_img"
      alt=""
    />
    <img v-else src="../../src/assets/w1.gif" alt="" />
    <div class="info">
      <div class="title">{{ follow.nickname }}</div>
      <div class="data">2020-09-23</div>
    </div>
    <div class="btnCancel" @click="handleClick">取消关注</div>
  </div>
</template>

<script>
export default {
  props: ["follow"],
  methods: {
    handleClick() {
      this.$emit("btnCancel", this.follow.id);
    },
  },
};
</script>

<style lang="less" scoped>
.follow {
  display: flex;
  align-items: center;
  padding: 18/360 * 100vw;
  border-bottom: 1px solid #e4e4e4;
  img {
    width: 40/360 * 100vw;
    height: 40/360 * 100vw;
    border-radius: 50%;
    object-fit: cover;
  }
  .info {
    flex: 1;
    padding-left: 10/360 * 100vw;
    .title {
      font-size: 16/360 * 100vw;
    }
    .data {
      font-size: 14/360 * 100vw;
      color: #888;
      margin-top: 4/360 * 100vw;
    }
  }
  .btnCancel {
    font-size: 13/360 * 100vw;
    height: 32/360 * 100vw;
    line-height: 32/360 * 100vw;
    padding: 0 10/360 * 100vw;
    border-radius: 16/360 * 100vw;
    color: #333;
    background-color: #e6e6e6;
  }
}
</style>
